using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class IC_MaxNumMap : EntityTypeConfiguration<IC_MaxNum>
    {
        public IC_MaxNumMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FTableName, t.FUserID, t.FNumber });

            // Properties
            this.Property(t => t.FTableName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FUserID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FNumber)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("IC_MaxNum");
            this.Property(t => t.FTableName).HasColumnName("FTableName");
            this.Property(t => t.FUserID).HasColumnName("FUserID");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FFlag).HasColumnName("FFlag");
        }
    }
}
